NAME
bind - open socket and bind it to a port
SYNTAX
int port->bind(int port);
or
int port->bind(int port,function accept_callback);
or
int port->bind(int port,function accept_callback, string ip);
DESCRIPTION
Bind opens a sockets and binds it to port number on the local machine.
If the second argument is present, the socket is set to nonblocking
and the callback funcition is called whenever something connects to
the socket. The callback will receive the id for this port as argument.
Bind returns 1 on success, and zero on failiure.
If the optional argument 'ip' is given, bind will try to bind to
this ip name (or number).
SEE ALSO